package git.soulbgm.controller;

import git.soulbgm.pojo.BaseMsg;
import git.soulbgm.service.TcpClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author 贺瑞杰
 * @version V1.0
 * @date 2018-11-09 16:39
 * @description
 */
@RestController
public class TcpController {

    @Autowired
    private TcpClient tcpClient;

    @RequestMapping("sendMessage")
    public String sendMessage(BaseMsg msg){
        boolean flag = tcpClient.sendMsg(msg);
        return flag ? "success" : "error";
    }

}
